﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FifthSpaceModel;
using FifthSpaceDAL;
using System.Threading.Tasks;

namespace FifthSpaceBLL
{
    public class UserManager
    {
        #region 登录验证
        public bool LogIn(string UserId, string Password, out User validUser)
        {
            User user = new UserService().UserLoginByUserId(UserId);
            if (user == null)
            {
                validUser = null;//用户名不存在 
                return false;
            }

            if (user.Password == Password)
            {
                validUser = user;
                return true;
            }
            else
            {
                validUser = null;//密码错误 
                return false;
            }
        }
        #endregion

    }
}
